package com.common.security.abstracts;

import com.common.security.interfaces.ISecurity;

/**
 * Exceptions are errors created at runtime by unexpected situations.
 * Exception will not be logged in database.
 * They should offer a way to escape the current situation and continue the process.
 * 
 * Contain:
 * int code - the code of the exception
 * 
 * Default error code range: 1001 - 1020
 * 
 * @author Ady
 *
 */
public abstract class AbstractException extends Exception implements ISecurity {

	private static final long serialVersionUID = 1L;
	
	public static final int ERROR_NOT_FOUND = 1001;
	protected static final String MESSAGE_ERROR_NOT_FOUND = "Error not found";

	private int code;
	
	public AbstractException(int code, String message) {
		super(message);
		this.code = code;
	}
	
	public int getCode() {
		return code;
	}
	
	public void setCode(int code) {
		this.code = code;
	}
}
